#!/usr/bin/env python
#coding=utf-8
import requests
import xmltodict
import json
# 发送短信验证码data
from configs.sms_4A import SMS_URL
# APP_ID_TEST = "4028d1c683b55f3101848369fadc0012"
APP_ID_TEST = "ff80808178b51de1017945da8c640038"
send_sms_data ={
    "method":"sendSMSByMasterAcc",
    "appid": APP_ID_TEST,
    "masterAcc":"18308576111",
}
# 验证短信验证码data
check_sms_data ={
    "method":"masterAccSmsPwdAuth",
    "smsPwd":"975440",
    "appid": APP_ID_TEST,
    "masterAcc":"18308576111",
}

#发送验证码
def send_sms_code(data):
    try:
        res = requests.post(SMS_URL, data)
        json_data = xmltodict.parse(res.text, encoding='utf-8')
        res = json.loads(json.dumps(json_data))
    except Exception as e:
        print(e)
    return res



if __name__ == '__main__':
    # res = send_sms_code(send_sms_data)
    res = send_sms_code(send_sms_data)
    print(res)